var u = Object.defineProperty, v = Object.defineProperties;
var I = Object.getOwnPropertyDescriptors;
var g = Object.getOwnPropertySymbols;
var y = Object.prototype.hasOwnProperty, w = Object.prototype.propertyIsEnumerable;
var r = (e, t, o) => t in e ? u(e, t, { enumerable: !0, configurable: !0, writable: !0, value: o }) : e[t] = o, d = (e, t) => {
  for (var o in t || (t = {}))
    y.call(t, o) && r(e, o, t[o]);
  if (g)
    for (var o of g(t))
      w.call(t, o) && r(e, o, t[o]);
  return e;
}, f = (e, t) => v(e, I(t));
import { ref as m, watch as k, onMounted as p } from "vue";
import { c as x } from "../props-c0e5b20d.mjs";
import { c as S } from "../component-87e22bdd.mjs";
/*!
* Vin UI 移动端 Vue3 组件库 v0.2.9 Fri Jun 02 2023 21:01:02 GMT+0800 (中国标准时间)
* (c) 2023 @vingogo.
* Released under the MIT License.
*/
const A = f(d({}, x), {
  type: {
    type: String,
    default: "one"
    // one multi
  },
  videos: {
    type: Array,
    default: () => []
  },
  images: {
    type: Array,
    default: () => []
  }
}), { create: E } = S("comment-images"), j = E({
  props: A,
  emits: ["click", "clickImages"],
  setup(e, { emit: t }) {
    const o = m(!1), l = m(1), c = m([]);
    return k(
      () => [e.videos, e.images],
      (s) => {
        s[0].length > 0 && s[0].forEach((a) => {
          a.type = "video";
        }), c.value = s[0].concat(s[1]);
      },
      { deep: !0 }
    ), p(() => {
      e.videos.length > 0 && e.videos.forEach((s) => {
        s.type = "video";
      }), c.value = e.videos.concat(e.images);
    }), { isShowImage: o, initIndex: l, showImages: (s, a) => {
      const { videos: n, images: h } = e, i = s === "img" ? a - n.length : Number(a);
      t("clickImages", {
        type: s,
        index: i,
        value: s === "img" ? h[i] : n[i]
      });
    }, totalImages: c };
  }
});
export {
  j as default
};
